package com.example.demo.job;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author: twd
 * @since: 2023/7/21 16:28
 */
@Component
public class Job1 {
//    @Autowired
//    ScheduledProcessor scheduledProcessor;
    public int a = 0;
    @Scheduled(cron = "*/2 * * * * ?")
    public void j(){
        System.out.println("job1"+a);
//        if(a >= 10){
//            scheduledProcessor.stopTask(scheduledProcessor.getBean(Job1.class));
//        }
//        a++;
    }
}
